test for consistency and solve